using MicroMsg.Manager;
using MicroMsg.Storage;
using System;
namespace MicroMsg.UI.UserContrl
{
	public class SnsUserPageItemData : IListDataItem
	{
		public int nLocalID;
		public string strObjectId;
		public uint nCreateTime;
		public bool bIsNeedShowData = true;
		public string strDescription;
		public string strLocation;
		public TimeLineObject tloObj;
		public SnsInfoStatus nStatus = SnsInfoStatus.STATUS_COMPLETE;
		public SnsGroupList mGroupList;
		public SnsUserPageItemData(SnsInfo snsInfo = null)
		{
			if (snsInfo != null)
			{
				this.nLocalID = snsInfo.nLocalID;
				this.strObjectId = snsInfo.strObjectID;
				this.nCreateTime = snsInfo.nCreateTime;
				this.tloObj = SnsInfoMgr.getTimeLine(snsInfo);
				if (this.tloObj == null)
				{
					TimeLineObject.dumpXmlData(snsInfo.bytesObjectDesc);
					return;
				}
				if (this.tloObj.tloLocation_0 != null)
				{
					this.strLocation = this.tloObj.tloLocation_0.strCity;
				}
				this.strDescription = this.tloObj.strContentDesc;
				if (snsInfo.strUserName == AccountMgr.curUserName && snsInfo.nStatus == 4)
				{
					this.nStatus = SnsInfoStatus.STATUS_ERROR;
				}
				this.mGroupList = snsInfo.groupList;
			}
		}
		public void FillData(object item)
		{
			SnsUserPageItemData snsUserPageItemData = item as SnsUserPageItemData;
			if (snsUserPageItemData == null)
			{
				return;
			}
			snsUserPageItemData.nLocalID = this.nLocalID;
			snsUserPageItemData.nCreateTime = this.nCreateTime;
			snsUserPageItemData.strDescription = this.strDescription;
			snsUserPageItemData.strLocation = this.strLocation;
			snsUserPageItemData.strObjectId = this.strObjectId;
			snsUserPageItemData.bIsNeedShowData = this.bIsNeedShowData;
			snsUserPageItemData.tloObj = this.tloObj;
			snsUserPageItemData.nStatus = this.nStatus;
			snsUserPageItemData.mGroupList = this.mGroupList;
		}
	}
}
